package com.sourcetrip.my.abs;


import com.sourcetrip.my.LinkedListV0;
import com.sourcetrip.my.inter.Queue;

/**
 * @author: ZhouBert
 * @date: 2020/12/14
 * @description:	默认 Queue 和 Deque 都是用 LinkedList 实现
 */
public abstract class AbstractQueue<E> implements Queue<E> {

	protected LinkedListV0<E> list = new LinkedListV0<>();


	@Override
	public int size() {
		return list.size();
	}

	@Override
	public boolean isEmpty() {
		return list.isEmpty();
	}

	@Override
	public void clear() {
		list.clear();
	}

	@Override
	public abstract void enQueue(E element);

	@Override
	public abstract E deQueue();

	@Override
	public abstract E peek();
}
